<template>
  <div>
    <div
      class="icon-selector"
      :class="{ 'selector-active': checked }"
      @click="isChecked"
    >
      <img src="~assets/img/cart/tick.svg" alt="" />
    </div>
  </div>
</template>

<script>
export default {
  name: "CheckButton",
  props: {
    value: {
      type: Boolean,
      default: true,
    },
  },
  data() {
    return {
      checked: this.value,
    };
  },
  methods: {
    isChecked() {
      this.$emit("checkButton");
    },
  },
  watch: {
    value(newValue) {
      this.checked = newValue;
    },
  },
};
</script>

<style scoped>
.icon-selector {
  /* background-color: pink; */
  border-radius: 50%;
  border: 2px solid pink;
}

.selector-active {
  background-color: pink;
  /* border-color: pink; */
}
</style>